package  
{
	/**
	 * ...
	 * @author UWGameDevClub
	 */
	public class FrameItem extends Item
	{
		//an array of bitmaps (the frames)
		private var _bitmapArray:Array;
		
		public function FrameItem(images:Array, name:String) 
		{
			super(null, name);
			
			_bitmapArray = new Array();
			for each(var image:Class in images) {
				_bitmapArray.push(new image());
			}
			
			_bitmap = _bitmapArray[0];
			addChild(_bitmap);
		}
		
		public function frame(frameIndex:int):void {
			removeChild(_bitmap);
			_bitmap = _bitmapArray[frameIndex];
			addChild(_bitmap);
		}
		
	}

}